/*
 * @Author: 李泽琛
 * @Date: 2021-06-08 11:36:06
 * @LastEditTime: 2021-06-08 14:24:16
 * @Description: file content
 */
const { handelPointByAirLine } = require("./handle/access");

const page = +process.argv[2];

(async function () {
  console.log(`准备处理第${page}页数据...`);
  const t0 = Date.now();
  process.on("message", async (data) => {
    const result = [];
    for (let item of data) {
      const r = await handelPointByAirLine(item, page);
      result.push(r);
    }
    process.send(result);
    console.log(`第${page}页数据处理完成，耗时：${new Date().getTime() - t0}ms`);
    process.exit();
  });
})();
